<?php
/**
 * JoiEditor - Joostina WYSIWYG Editor
 *
 * Backend content viewer. List of configs.
 *
 * @version 1.0 beta 3
 * @package JoiEditor
 * @subpackage	Admin
 * @filename config.php
 * @author JoostinaTeam
 * @copyright (C) 2008-2010 Joostina Team
 * @license see license.txt
 *
 **/

defined('_VALID_MOS') or die();

$user_groups = joiEditor::get_user_groups();
?>

<table class="adminheading">
	<tr><th class="config">joiEditor - <?php echo _C_JOIEDITOR_ADMIN_LIST_CONFIG;?></th></tr>
</table>
<form action="index2.php" method="post" name="adminForm" id="adminForm">
	<table class="adminlist" width="100%">
		<tr>
			<th width="30">&nbsp;</th>
			<th width="20"><input type="checkbox" name="toggle" value="" onClick="checkAll(<?php echo count( $configs );?>);" /></th>
			<th><?php echo _C_JOIEDITOR_ADMIN_CONFIG;?></th>
			<th><?php echo _C_JOIEDITOR_ADMIN_USERGROUP;?></th>
			<th width="200"><?php echo _C_JOIEDITOR_ADMIN_INIT_FILE;?></th>
			<th width="30"><?php echo _C_JOIEDITOR_ADMIN_CHECK_RIGHTS;?></th>
		</tr>
		<?php
		$i = 0;
		foreach($configs as $config) {
			$dop_group = '';

			$curr = $config->component;
			$link = 'index2.php?option='.$option.'&task=config&group='.$config->component;
			if($config->user_group) {
				$link .= $dop_group = '_gid_'.$config->user_group;
				$curr .= '_gid_'.$config->user_group;
			}

			$init_file = JPATH_BASE.DS.'components'.DS.'com_joieditor'.DS.'inits'.DS.$config->component.$dop_group.'.js';
			?>
		<tr>
			<td><?php echo $pageNav->rowNumber( $i ); ?></td>
			<td><?php echo mosHTML::idBox($i, $curr); ?></td>
			<td><a href="<?php echo $link;?>"><?php echo $config->component; ?></a></td>
			<td align="center">
					<?php if($config->user_group):?>
						<?php echo $user_groups[$config->user_group];?> (id: <?php echo $config->user_group;?>)
					<?php endif; ?>
			</td>
			<td><?php echo 'inits'.DS.$config->component.$dop_group.'.js'; ?></td>
			<td align="center">
					<?php $check = 'tick.png';
					if( !joiEditor::check_file_access($init_file) ) {
		$check = 'publish_x.png';
	} ?>
			<?php echo mosHTML::get_image($check, 'ico'); ?>
			</td>
		</tr>
	<? $i++;
} ?>

	</table>
	<input type="hidden" name="option" value="<?php echo $option; ?>" />
	<input type="hidden" name="task" value="" />
	<input type="hidden" name="<?php echo josSpoofValue(); ?>" value="1" />
	<input type="hidden" name="boxchecked" value="0" />
</form>